<?php
//我项目中使用的是ThinkPHP框架，Ajax的请求地址是一个方法<br>

public function getLabelData()
{
    $pageNum = I('pageNum');
    $totalItem = M('label')->count();
    $pageSize = 6;
    $totalPage = ceil($totalItem/$pageSize);
 
    $startItem = ($pageNum-1) * $pageSize;
    $arr['totalItem'] = $totalItem;
    $arr['pageSize'] = $pageSize;
    $arr['totalPage'] = $totalPage;
 
    $labels = M('label')->limit($startItem,$pageSize)->select();
 
    foreach($labels as $lab) {
        $arr['data_content'][] = $lab;
    }
 
    echo json_encode($arr);
}

?>